import request from '@/utils/request'

// 获取阶段树数据
export function getAllTree(data) {
  return request({
    url: '/zt/phases/tree/node/findAll',
    method: 'post',
    data: data
  })
}

export function getByIdTree(data) {
  return request({
    url: '/zt/phases/tree/node/findByIdTree?id=' + data,
    method: 'get'
  })
}
// 新增阶段节点
export function addNode(data) {
  return request({
    url: '/zt/phases/tree/node/save',
    method: 'post',
    data: data
  })
}

// 获取阶段节点信息
export function getNodeDetail(query) {
  return request({
    url: '/zt/phases/tree/node/findById',
    method: 'get',
    params: query
  })
}

// 修改阶段节点
export function updateNode(data) {
  return request({
    url: '/zt/phases/tree/node/update',
    method: 'put',
    data: data
  })
}

// 删除阶段节点
export function deleteNode(query) {
  return request({
    url: '/zt/phases/tree/node/delete',
    method: 'delete',
    params: query
  })
}

// 获取树列表
export function getCodeList(data) {
  return request({
    url: '/zt/file/condition?pageNum=' + data.pageNum + '&pageSize=' + data.pageSize,
    method: 'post',
    data: data
  })
}

// 新增文件
export function addFile(data) {
  return request({
    url: '/zt/file/save',
    method: 'post',
    data: data
  })
}

// 获取文件详情
export function getFileDetail(query) {
  return request({
    url: '/zt/file/findById',
    method: 'get',
    params: query
  })
}

// 修改文件
export function updateFile(data) {
  return request({
    url: '/zt/file/update',
    method: 'put',
    data: data
  })
}

// 删除文件
export function deleteFile(query) {
  return request({
    url: '/zt/file/delete',
    method: 'delete',
    params: query
  })
}

